home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Communication / NewsBase / Source / INewsGroupTreeControl.h < prev    next >
Text File  |  1993-01-12  |  4KB  |  117 lines

  1. /*$Copyright:
  2.  * Copyright (C) 1992.5.22. Recruit Co.,Ltd. 
  3.  * Institute for Supercomputing Research
  4.  * All rights reserved.
  5.  * NewsBase  by ISR, Kazuto MIYAI, Gary ARAKAKI, Katsunori SUZUKI, Kok-meng Lue
  6.  *
  7.  * You may freely copy, distribute and reuse the code in this program under 
  8.  * following conditions.
  9.  * - to include this notice in the source code, if it is to be distributed 
  10.  *   with source code.
  11.  * - to add the file named "COPYING" within the code, which shall include 
  12.  *   GNU GENERAL PUBLIC LICENSE(*).
  13.  * - to display an acknowledgement in binary code as follows: "This product
  14.  *   includes software developed by Recruit Co.,Ltd., ISR."
  15.  * - to display a notice which shall state that the users may freely copy,
  16.  *   distribute and reuse the code in this program under GNU GENERAL PUBLIC
  17.  *   LICENSE(*)
  18.  * - to indicate the way to access the copy of GNU GENERAL PUBLIC LICENSE(*)
  19.  *
  20.  *   (*)GNU GENERAL PUBLIC LICENSE is stored in the file named COPYING
  21.  * 
  22.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  23.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  24.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  25. $*/
  26. /*
  27.  *    INewsGroupTreeControl is a subclass of the INNTP class.
  28.  *    It initializes and maintains the newsgroup tree.
  29.  *     It also handles the posting of articles.
  30.  *    It handles all communication with the NNTP server.
  31.  */
  32.  
  33. #import "INNTP.h"
  34. #import <appkit/Panel.h>
  35. #import "InfoD.h"
  36. #import "IPercentageView.h"
  37.  
  38. typedef enum {ALL, UNMARKEDONLY, MARKEDONLY} ReadFlag;
  39.  
  40. @interface INewsGroupTreeControl:INNTP
  41. {
  42.     id iNewsGroupTreeRoot;
  43.     NXZone *newsgroupTreeZone;
  44.     NXZone *headersZone;
  45.     id iCurrentNewsgroup;
  46.     id iCurrentArticleItem;
  47.     id iNewsRc;
  48.     BOOL iAllNewsFlag;
  49.     id        oGetArticleNumField;
  50.     Panel    *oGetArticleNumWindow;
  51.     IPercentageView    *iPercentageView;
  52. }
  53.  
  54. - initServer:(char *)nntpHost allNews:(BOOL)allNewsFlag;
  55.  
  56. /*
  57.  *  Generates the newsgroup tree.  Sends the "LIST" command to the NNTP
  58.  *  server.  Reads the list of valid newsgroups returned from the NNTP
  59.  *  server and generates a tree of INewsGroups objects.  If the tree is
  60.  *  generated returns the root of the generated tree else returns nil.
  61.  */
  62.  
  63. - listAndMakeNewsgroupTree;
  64.  
  65. - initNewsGroup:newsGroup readFlag:(ReadFlag)rflag;
  66. /*
  67.  *  Initializes all the headers for a newsgroup.
  68.  *
  69.  *  Allocates an IGroupD for the newsgroup.  Sends the "GROUP" command for
  70.  *  this newsgroup to the NNTP server.  Then for each article in this
  71.  *  newsgroup sends the "HEAD" command to the NNTP server and creates an
  72.  *  header InfoD and an article IGroupD.  The header InfoD is added to the
  73.  *  article IGroupD and the article IGroupD is added to the newsgroup
  74.  *  IGroupD.  If the newsgroup IGroupD is intialized returns the allocated
  75.  *  and initialized newsgroup IGroupD else returns nil.
  76.  */
  77.  
  78. - (BOOL)sendArticle:(const char *)messageId;
  79. /*
  80.  *  Initializes the body of an article.
  81.  *
  82.  *  Sends the "BODY" command to the NNTP server for this article.  
  83.  *  The article stream from the NNTP server is sent to the MMEditor.
  84.  */
  85.  
  86. - newsGroupTreeRoot;
  87.  
  88. - (const char *)currentNewsgroupName;
  89. /*
  90.  * Returns the name of the newsgroup last selected by the newsgroup browser.
  91.  */
  92.  
  93. - (BOOL)canPost;
  94. /*
  95.  * Returns YES if posting is allowed in the newsgroup last selected by the newsgroup browser.
  96.  */
  97.  
  98. - (void)saveNewsRcFile;
  99. - (InfoD *)commandHead:(int)knum articleDB:karticleDB;
  100. - (InfoD *)getHeader:(const char *)articleTag zone:(NXZone *)zone;
  101. - readNewsRcFile;
  102. - okArticleNumWindow:sender;
  103. - cancelArticleNumWindow:sender;
  104.  
  105. // set window when read articles
  106. - setOGetArticleNumWindow:kwindow;
  107. - setOGetArticleNumField:kfield;
  108. - setIPercentageView:kview;
  109.  
  110. // set timed entry for reconnecting to nntp server
  111. // it will be set when start
  112. - setTimedEntryForReconnect;
  113. - reconnectServer:sender;
  114. - cancelArticleMessageID:(const char *)messageID from:(const char *)fromValue;
  115.  
  116. @end
  117.